package rohyunji;

import java.util.Scanner;

public class J03_memberSVC implements J03_ImemberSVC {
	
	private J03_memberDAO mdao=
			new J03_memberDAO();
	
	
	public void createMember() 
	{
		System.out.println("1.회원가입");
		Scanner sc=new Scanner(System.in);
		
		J03_memberVO m=new J03_memberVO();
		System.out.println("아이디입력");m.setUserid(sc.next());
		System.out.println("비밀번호입력");m.setUserpwd(sc.next());
		System.out.println("이름입력");m.setUsername(sc.next());
		System.out.println("이메일입력");m.setUseremail(sc.next());
		
		if(mdao.insertMember(m))
			System.out.println("회원가입성공");
		else  System.out.println("회원가입실패");
	}


	@Override
	public void readMember() 
	{
		for(J03_memberVO m:mdao.selectMember())
		{
			System.out.print("번호="+m.getMno()+"\t이름="+m.getUsername()+"\t아이디="+m.getUserid()+"\t패스워드"+
					m.getUserpwd()+"\n\t이메일="+m.getUseremail()+"\t가입일:"+m.getJoindate()+"\n");
			
		}
	}

}
